﻿ using System;

namespace ACServerSelfHost
{
    public static class Log
    {
        public enum Target
        {
            Output,
            Info,
            Question,
            Debug,
            Error
        }

        public static void Write(string text)
        {
            Write(text, Target.Output);
        }

        public static void Write(string text, Target target)
        {
            ConsoleColor cc;

            switch (target)
            {
                case Target.Output:
                    cc = ConsoleColor.Green;
                    break;
                case Target.Info:
                    cc = ConsoleColor.DarkGray;
                    break;

                case Target.Question:
                    cc = ConsoleColor.Blue;
                    break;
                case Target.Debug:
                    cc = ConsoleColor.Yellow;
                    break;
                case Target.Error:
                    cc = ConsoleColor.Red;
                    break;
                default:
                    cc = ConsoleColor.Magenta;
                    break;
            }
            ConsoleColor originalColor = Console.ForegroundColor;
            Console.ForegroundColor = cc;
            Console.WriteLine(text);
            Console.ForegroundColor = originalColor;
        }
    }
}
